<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>弹窗测试</title>
    <script type="text/javascript" src="/js/jquery-3.4.1.js"></script>
    <script type="text/javascript" src="/js/comment.js"></script>
    <link rel="stylesheet" href="/css/bootstrap.min.css" type="text/css" />
    <script src="/js/bootstrap.min.js"></script>
</head>
<body>

<button class="btn btn-primary btn-lg aa" data-toggle="modal" style="display:none;" data-target="#myModal">
    开始演示模态框
</button>
<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content oo">

        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
<script>
    $(function () {
        function modeladd() {
            var content = "";
            if ([[${theFirstOne.id}]]==-1){
                $(".aa").attr('disabled',true);
            }
            else {
                var time = "[[${theFirstOne.time}]]";
                content+="    <form method='post' action='/evaluate/toEvaluate?id="+[[${theFirstOne.id}]]+"'>";
                content+="<div class=\"modal-body\">";
                content+="  <table>";
                content+="  <thead><tr><th colspan=\"2\"><h5>以下预约已结束，请评价服务吧!</h5></th></tr></thead>";
                content+="<tbody>";
                content+="  <tr class=\"tab-info-tr\"><th>医生:</th><td><span >"+"[[${theFirstOne.doctorName}]]"+"</span></td></tr>";
                content+=" <tr class=\"tab-info-tr\"><th>科室:</th><td><span >"+"[[${theFirstOne.departmentName}]]"+"</span></td></tr>";
                content+="  <tr class=\"tab-info-tr\"><th>预约时间:</th><td><span >"+time+"</span></td></tr>";
                content+=" </tbody> </table> </div> </div>";
                content+="  <div class=\"modal-footer\">";
                content+="<button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">取消评价</button>";
                content+="     <button type=\"submit\" class=\"btn btn-primary\">前往评价</button>";
                content+=" </div> </form>";
                $(".oo").html(content);
                $(".aa").trigger("click");
            }
        }
        modeladd();

    });
</script>
<script type="text/javascript">
    if (sessionStorage.pagecount)
    {
        sessionStorage.pagecount=Number(sessionStorage.pagecount) +1;
        $(".aa").attr('disabled',true);
    }else{
        sessionStorage.pagecount=1;
    }
</script>
</body>
</html>